<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Atividade extra-classe</title>
        <link rel="stylesheet" type="text/css" media="screen" href="../css/ui-lightness/jquery-ui-1.8.2.custom.css" />
        <link rel="stylesheet" type="text/css" media="screen" href="../css/ui.jqgrid.css" />
        <script src="../js/jquery.js" type="text/javascript"></script>
        <script src="../js/jquery-ui.js" type="text/javascript"></script>
        <script src="../js/i18n/grid.locale-pt-br.js" type="text/javascript"></script>
        <script src="../js/jquery.jqGrid.min.js" type="text/javascript"></script>
    </head>
    <body>

        <table id="list"></table>
        <div id="pager"></div>



    </body>
    <script type="text/javascript">
        var lastsel2 ;

        $(function(){
            $("#list").jqGrid({
                url:'getTipoAfastamento.jsp',
                datatype: 'xml',
                mtype: 'POST',
                colNames:['Descrição'],
                colModel :[
                    {name:'desc_tipoafastamento', index:'desc_tipoafastamento', width:180,edittype:"text",editable:true,sortable:false},
                ],
                onSelectRow: function(id){
                    if(id && id!==lastsel2){
                        jQuery('#list').jqGrid('restoreRow',lastsel2);
                        jQuery('#list').jqGrid('editRow',id,true);
                        lastsel2=id;
                    }
                },
                pager: '#pager',
                autowidth: true,
                height: 400,
                rowNum:'auto',
                pgbuttons: false,
                pgtext: false,
                pginput:false,
                sortname: 'desc',
                sortorder: 'desc_tipoafastamento',
                editurl: "update.jsp",
                caption: 'Atividades Extra-classe'
            });

            jQuery("#list").jqGrid('navGrid','#pager', {add:true,search:false}
        );

            $.ajaxSetup({
                contentType: "application/x-www-form-urlencoded; charset=UTF-8"
            });

        });

    </script>

</html>
